package com.bdqn;

/**
 * Test
 *
 * @author LILIBO
 * @since 2022-09-22
 */
public class TestByValue {

    public static void updObj(Student student) { // 堆里面的一个对象内存首地址 32位
        student.name = "T325" + student.name;
    }

    public static void updInt(int num) {
        num = num + 1;
        System.out.println("在方法中：" + num);
    }

    public static void main(String[] args) {

        // 引用传递
        Student student1 = new Student();
        student1.no = 1;
        student1.name = "田文鑫";
        TestByValue.updObj(student1);
        System.out.println(student1.name);

        // 值传递
        int n = 5;
        TestByValue.updInt(n);
        System.out.println(n);
    }
}
